<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<style>

body { margin: 0; }
#b { position: absolute; left: 0px; top: 0px; width: 1200px; height: 900px; }

</style>
<div id="b"></div>
<script>

test(() => {
    scrollTo(400, 300);
    b.addEventListener("mousedown", (e) => {
        result = [e.layerX, e.layerY];
    });
    eventSender.mouseMoveTo(700, 500);
    eventSender.mouseDown();
    eventSender.mouseUp();
    // layerX and layerY are relative to #b
    assert_array_equals(result, [1100, 800]);
});

</script>
